
% directory of crossover error files
localdirectory = '/Users/manojnair/Downloads/';
% get a list of files
s = dir([localdirectory '*.cross']);

% loop through files

for i = 1:length(s),
    
    
[lon	lat	t_1	t_2,	dist_1	dist_2	head_1	head_2	vel_1	vel_2	drt_1...
    drt_2	tz_1	tz_2	ptc_1	ptc_2	twt_1	twt_2	depth_1	depth_2...
    bcc_1	bcc_2	btc_1	btc_2	mtf1_1	mtf1_2	mtf2_1	mtf2_2	mag_1...
    mag_2	msens_1	msens_2	diur_1	diur_2	msd_1	msd_2	gobs_1	gobs_2...
    eot_1	eot_2	faa_1	faa_2	nqc_1	nqc_2] =  textread([localdirectory s(i).name],'%f%f%s%s%f%f%f%f%f%f%f%f%f%f%f%f%f%f%f%f%f%f%f%f%f%f%f%f%f%f%f%f%f%f%f%f%f%f%f%f%f%f%f%f','headerlines', 4);


% get the time converted to matlab

t1_mat = datenum(t_1,'yyyy-mm-ddTHH:MM:SS');
t2_mat = datenum(t_1,'yyyy-mm-ddTHH:MM:SS');

% convert time to mjd

t1_mat = t1_mat - datenum(2000,1,1);
t2_mat = t2_mat - datenum(2000,1,1);




end;
